﻿using StudyCompanion.Commons.Result;
using StudyCompanion.Dto.User;
using StudyCompanion.Entity.User;
using StudyCompanion.Model.User;

namespace StudyCompanion.IServices;

public interface IUserService
{
    /// <summary>
    ///     密码登录
    /// </summary>
    /// <param name="username"></param>
    /// <param name="password"></param>
    /// <returns></returns>
    Task<Tuple<Users, string>> PasswordLogin(string username, string password);

    /// <summary>
    ///     获取用户(根据电话号码）
    /// </summary>
    /// <param name="phone"></param>
    /// <returns></returns>
    Task<Tuple<bool, Users>> GetUserbyPhone(string phone);

    /// <summary>
    ///     获取用户(根据用户ID）
    /// </summary>
    /// <param name="userId"></param>
    /// <returns></returns>
    Task<Tuple<bool, Users>> GetUserbyId(long userId);

    /// <summary>
    ///     更新用户密码
    /// </summary>
    /// <param name="userId"></param>
    /// <param name="dto"></param>
    /// <returns></returns>
    Task<CommonResult> ChangeUserPassword(long userId, ChangeUserPasswordDto dto);

    /// <summary>
    ///     更新用户信息
    /// </summary>
    /// <param name="dto"></param>
    /// <returns></returns>
    bool UpdateUsers(Users dto);

    /// <summary>
    ///     获取或者添加用户
    /// </summary>
    /// <param name="phone"></param>
    /// <returns></returns>
    Task<Users> GetOrInsertUserByPhone(string phone);

    /// <summary>
    ///     学生年级
    /// </summary>
    /// <returns></returns>
    List<StudyClassVo> StudyClass();

    /// <summary>
    ///     忘记密码
    /// </summary>
    /// <param name="dto"></param>
    /// <returns></returns>
    Task<CommonResult> ForgetPassword(ForgetPasswordDto dto);

    /// <summary>
    ///     设置支付密码
    /// </summary>
    /// <param name="uId"></param>
    /// <param name="dto"></param>
    Task<CommonResult> ReplenishPayPass(long uId, ReplenishPayPassDto dto);

    /// <summary>
    ///     快速登录手机号获取
    /// </summary>
    /// <param name="dto"></param>
    /// <returns></returns>
    Tuple<bool, string> SimpleLogin(SimpleLoginDto dto);

    /// <summary>
    ///     伙伴数据
    /// </summary>
    /// <param name="userContextId"></param>
    /// <returns></returns>
    PartnerVo Partner(long userContextId);
}